/**并没有对axios 做外层封装，只是，对axios 做了一下前置后置出来，添加了
   一些参数，返回的还是axios 对象，用法和axios 一样
**/
import request from '@/utils/system/request'
import store from "@/store/index.ts"

// ===首页监控===
// 列表数据
export function getListApi(data: object) {
  return request({
    url: '/mainPage/getList',
    method: 'post',
    data
  })
}


// 新增任务
export function addTask(data: object) {
  console.log(store.state.user, "store")
  return request({
    url: '/mainPage/addTask',
    method: 'post',
    data
  })
}

//删除任务
export function delTask(data: object) {
  console.log(store.state.user, "store")
  return request({
    url: '/mainPage/delTask',
    method: 'post',
    data
  })
}

//运行任务
export function runTaskApi(data: object) {
  return request({
    url: '/mainPage/runTask',
    method: 'post',
    data
  })
}

//=========评论列表============
// 列表数据
export function getCustomerListApi(data: object) {
  return request({
    url: '/customer/getList',
    method: 'post',
    data
  })
}

//全部私信
export function sendMsgApi(data: object) {
  return request({
    url: '/customer/sendMsg',
    method: 'post',
    data
  })
}


//=========词库设置=================
// 添加词库
export function addKeysApi(data: object) {
  return request({
    url: '/set/addKeys',
    method: 'post',
    data
  })
}

// 编辑词库
export function editKeywordsApi(data: object) {
  return request({
    url: '/set/editKeys',
    method: 'post',
    data
  })
}

//获取词库列表
export function getKeysListApi(data) {
  return request({
    url: '/set/getList',
    method: 'post',
    data
  })
}
//获取词库列表(选择框使用)
export function getKeywordListForSelApi(data) {
  return request({
    url: '/set/getListForSel',
    method: 'post',
    data
  })
}
//删除词库
export function delKeyWordsApi(data) {
  return request({
    url: '/set/del',
    method: 'post',
    data
  })
}

//==========获取服务列表============
export function getServiceListApi() {
  return request({
    url: '/getServiceList',
    method: 'post',
  })
}




